@echo off
title Deploying Workflow...
echo Deploying Workflow...

echo RY_HOME: %~1
echo SCRIPT_HOME: %~2
cd /d "%~1\ruoyi-modules\ruoyi-workflow"

echo.
echo Image Build..............
docker build -t regwmsuat.azurecr.io/ruoyi/workflow:latest .

echo.
echo Image Push..............
docker push regwmsuat.azurecr.io/ruoyi/workflow:latest

echo.
echo K8s Deploy..............
kubectl apply -f %~2\prod\workflow\manifest.yml
kubectl rollout restart deployment ruoyi-workflow -n nimbus
timeout /nobreak /t 5

echo.
echo Delete Image..............
docker rmi regwmsuat.azurecr.io/ruoyi/workflow:latest
